import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_elf/config/component_index.dart';

class LifeCyclePage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return LifeCyclePageState();
  }
}
class LifeCyclePageState extends State<LifeCyclePage>{

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    globalPrint('生命周期 ======  initState');
  }

  @override
  void didChangeDependencies() {
    // TODO: implement didChangeDependencies
    super.didChangeDependencies();
    globalPrint('生命周期 ======  didChangeDependencies');
  }

  @override
  void didUpdateWidget(LifeCyclePage oldWidget) {
    // TODO: implement didUpdateWidget
    super.didUpdateWidget(oldWidget);
    globalPrint(oldWidget.toString());
  }


  @override
  Widget build(BuildContext context) {
    globalPrint('生命周期 ======  build');
    return Scaffold(
      appBar: AppBar(title: Text('测试'),),
      body: GestureDetector(
          onTap: (){
            NavigatorUtils.navigatorRouter(context, LifeCyclePage());
          },
          child: Text('===',style: TextStyle(fontSize: 30),)),
    );
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
    globalPrint('生命周期 ======  dispose');
  }

}